import store from '@/store'
export default {
  install(Vue) {
    Vue.prototype.$fn = () => {
      console.log('Vue..... $fn')
    }

    Vue.directive('allow', {
      inserted: function(el, binding) {
        const points = store.state.user.userInfo.roles.points
        // console.log(binding.value, points)
        if (!points.includes(binding.value)) {
          el.remove() // 直接删除这个dom
        }
        // if (points.includes(binding.value)) {
        //   console.log(binding.value, '按钮可见')
        // } else {
        //   // 直接删除这个dom
        //   el.remove()
        // }
      }
    })
  }
}
